namespace Arcane.Source.Data;

public class ElementDB
{
    public readonly ElementData[] elements = new ElementData[6];

    public void Init(string path)
    {
        LoadUtil.LoadRecursive<ElementRes>(
            path,
            (id, res) => Get(id.ParseElement().Value) = ElementData.Create(res),
            file => file.EndsWith("res")
        );
    }

    public ref ElementData Get(Element element)
    {
        return ref elements[(int)element];
    }
}